package net.toby200.canalstoppages.model;


public class Location {
	private double lat;
	private double lng;
	
	// for objectify
	@SuppressWarnings("unused")
	private Location() {		
	}
	
	public Location(double lat, double lng) {
		super();
		this.lat = lat;
		this.lng = lng;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("(").append(lat).append(", ").append(lng).append(")");
		return builder.toString();
	}

	public double getLat() {
		return lat;
	}

	public double getLng() {
		return lng;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(lat);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(lng);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Location other = (Location) obj;
		if (Double.doubleToLongBits(lat) != Double.doubleToLongBits(other.lat))
			return false;
        return Double.doubleToLongBits(lng) == Double.doubleToLongBits(other.lng);
    }

	
	

	
}
